home *** CD-ROM | disk | FTP | other *** search
- property bugx, bugy, bodychan, bodylist, lipchan, bugbody, buglips, bugsayit, bugsound, bugtempo, hypno, bugtext, mouseout
-
- on birth me, bchan, lchan, commandset
- set bugx to the locH of sprite bchan
- set bugy to the locV of sprite bchan
- set lipchan to lchan
- set bodychan to bchan
- puppetSprite(lchan, 1)
- puppetSprite(bchan, 1)
- set bugbody to the castNum of sprite bchan
- set buglips to getaProp(commandset, #lips)
- set bugsound to getaProp(commandset, #sound)
- set bugtext to getaProp(commandset, #text)
- set bodylist to value(string(getaProp(commandset, #body)))
- repeat with xxx in bodylist
- setAt(xxx, 2, the number of cast getAt(xxx, 2))
- end repeat
- set mouseout to 1
- put bodylist
- return me
- end
-
- on sayit me
- if hypno = 0 then
- grabbuggy(me)
- end if
- set soundtime to the size of cast bugsound / 183.0
- set soundscale to the number of chars in bugtext / soundtime
- puppetSound(bugsound)
- updateStage()
- set stime to the timer
- set numchar to the number of chars in bugtext
- repeat while the timer < (soundtime + stime + 20)
- set ptime to the timer - stime
- set presentchar to 1 + (soundscale * ptime)
- if presentchar <= numchar then
- set the castNum of sprite lipchan to getaProp(buglips, char presentchar of bugtext)
- else
- set the castNum of sprite lipchan to getaProp(buglips, " ")
- end if
- updateStage()
- if the mouseDown and (mouseout = 1) then
- exit repeat
- end if
- end repeat
- set the castNum of sprite lipchan to getaProp(buglips, " ")
- end
-
- on releasebuggy me
- puppetSprite(lipchan, 0)
- puppetSprite(bodychan, 0)
- set hypno to 0
- end
-
- on grabbuggy me
- puppetSprite(lipchan, 1)
- puppetSprite(bodychan, 1)
- set the castNum of sprite bodychan to bugbody
- sactivate(26, sinfo(25))
- set the castNum of sprite lipchan to getAt(buglips, 1)
- set hypno to 1
- end
-